package com.feng.security.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RouterController {

    @RequestMapping({"/","/index"})
    public String toIndexPage(){
        return "index";
    }

    @RequestMapping("/toLogin")
    public String toLogin(){
        return "views/login";
    }

    /**
     * 一个请求根据参数不同，可以控制9个页面（当然如果写得更多的话，也可以控制更多的）
     * @param level
     * @param id
     * @return
     */
    @RequestMapping("/{level}/{id}")
    public String leavel(@PathVariable("level")String level,
                         @PathVariable("id")String id){
        String str = "views/"+level+"/"+id;
        return str;
    }
}
